
        
package com.mall.order.common;

import com.mall.order.dao.entity.DemoAppBaseInfo;
import com.mall.order.model.DemoAppBaseInfoVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Date;

/**
 * @Description: DemoDemoAppBaseInfo pojo转换类
 * 用于转换Do,Vo的工具类，需要专门写转换类
 * 使用BeanUtils.copyProperties(source, target, ignoreProperties)方式，因为后续如果对modle 进行修改的时候，编译器无法发现
 * @Author: zhouzhao
 * @CreateTime: 2022/10/19 10:38:29
 */
public class DemoAppBaseInfoConverter {

    private static final Logger LOGGER = LoggerFactory.getLogger(DemoAppBaseInfoConverter.class);

    /**
     * voToDo
     *
     * @param VO
     * @return
     */

    public static DemoAppBaseInfo voToDo(DemoAppBaseInfoVo VO) {
        DemoAppBaseInfo DO = new DemoAppBaseInfo();

        DO.setName(VO.getName());
        DO.setDescription(VO.getDescription());
        DO.setModifyTime(new Date());
        DO.setCreateTime(new Date());

        return DO;
    }

    /**
     * doToVo
     *
     * @param DO
     * @return
     */
    public static DemoAppBaseInfoVo doToVo(DemoAppBaseInfo DO) {
        DemoAppBaseInfoVo VO = new DemoAppBaseInfoVo();

        VO.setName(DO.getName());
        VO.setDescription(DO.getDescription());
        VO.setModifyTime(DO.getModifyTime());

        return VO;
    }

}
